package com.dz51.core.utils;

import java.lang.annotation.Annotation;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.dz51.core.log4j.ILog4jManager;

/**
 * @Title: CheckAnnotationUtils.java
 * @Package com.dz51.utils
 * @Description: <p>
 *               校验该对象是否被注解
 *               </p>
 * @author Zhaoqt
 * @date 2014-5-4 上午7:35:34
 * @version V1.0
 */
@Component(value = "com.dz51.core.utils.CheckAnnotationUtils")
public class CheckAnnotationUtils {

	@Autowired
	protected ILog4jManager log4jManager;

	/**
	 * 该对象是否存在注解
	 * 
	 * @Title: checkAnnotation
	 * @param object
	 * @param className
	 * @return
	 * @throws Exceptionboolean
	 */
	public boolean checkAnnotation(Object object, Class<? extends Annotation> className) throws Exception {
		// 初始结果为 false
		boolean result = false;
		Class<?> clazz = object.getClass();
		boolean isExtendsEntity = clazz.isAnnotationPresent(Annotation.class);
		if (isExtendsEntity) {
			result = true;
		}
		return result;
	}
}
